In a motor controller comprising switching elements such as MOS-FETs or the like arranged in a power supply line to a motor, current command values corresponding to target output of the motor are determined, target applied voltage values to the motor are calculated based on the current command values, PWM control signals having duty cycle corresponding to the target applied voltage values are generated, and the output of the motor is controlled by switching on and off the switching elements constituting an inverter circuit with the PWM control signals (Japanese Laid-open Patent No. 2001-268980).